#ifndef SETTINGS_H
#define SETTINGS_H

/* la classe Settings maintient la configuration du Minuteur entre deux sessions */

#include <QSettings>
#include <QIcon>
#include <QColor>
#include <QString>

// liste des définitions globales

#define APP_ICON_PATH				(":/images/applogo.png")
#define MAGNUM_ICON_PATH			(":/images/mandriva_logo.png")
#define ALERT_ICON_PATH				(":/images/appointment-missed.png")
#define NEW_ICON_PATH				(":/images/appointment-new.png")
#define SYSTRAY_PROGRESS_COLOR		(QColor (Qt::yellow))
#define SYSTRAY_BACKGROUND_COLOR    (QColor (Qt::green))
#define SYSTRAY_FONT_COLOR			(QColor (Qt::black))
#define STANDARD_TOOLTIP			(QObject::tr("Le Minuteur\nUne application de PapaJaac !"))
#define TOOLTIPS_TITLE				(QObject::tr("Rappels :"))
#define MESSAGE_TITLE				(QObject::tr("Le Minuteur vous informe :"))
#define MESSAGE_DURATION			(15)
#define APP_TITLE					(QObject::tr("Magnum - Le Minuteur"))
#define PUB							(QObject::tr("Nouvelle version du Minuteur"))

//-------------------------------
class Settings : public QSettings
{
    Q_OBJECT

private:
    bool	m_isBlinking;
    QString	m_appIconPath;
    QString	m_magnumIconPath;
    QString m_newIconPath;
    QString	m_alertIconPath;

    QColor	m_systrayProgressColor;
    QColor	m_systrayBackgroundColor;
    QColor	m_systrayFontColor;
    QString	m_standardToolTip;
    QString	m_tooltipsTitle;
    QString	m_messageTitle;
    int		m_messageDuration;
    QString	m_appTitle;
    QString	m_pub;

public:
    Settings(const QString& org, const QString& app, QObject* obj);
    ~Settings ();

    bool	isBlinking () const { return m_isBlinking; }
    QIcon	appIcon () const { return QIcon (m_appIconPath); }
    QIcon	magnumIcon () const { return QIcon (m_magnumIconPath); }
    QIcon	alertIcon () const { return QIcon::fromTheme ("appointment-missed",
                                                          QIcon (m_alertIconPath)); }
    QIcon	newIcon () const { return QIcon::fromTheme ("appointment-new",
                                                        QIcon (m_newIconPath)); }
    QColor	systrayProgressColor () const { return m_systrayProgressColor; }
    QColor	systrayBackgroundColor () const { return m_systrayBackgroundColor; }
    QColor	systrayFontColor () const { return m_systrayFontColor; }
    QString standardToolTip () const { return m_standardToolTip; }
    QString tooltipsTitle () const { return m_tooltipsTitle; }
    QString messageTitle () const { return m_messageTitle; }
    int		messageDuration () const { return m_messageDuration; }
    QString appTitle () const { return m_appTitle; }
    QString pub () const { return m_pub; }

    void	read ();
    void	write ();

public slots:
    void setBlinking (bool on) { m_isBlinking = on; }
    void setMagnumIcon (QString path) { m_magnumIconPath = path; }
    void setAlertIcon (QString path) { m_alertIconPath = path; }
    void setSystrayProgressColor (QColor color) { m_systrayProgressColor = color; }
    void setSystrayBackgroundColor (QColor color) { m_systrayBackgroundColor = color; }
    void setSystrayFontColor (QColor color) { m_systrayFontColor = color; }
    void setStandardTooltip (QString txt) { m_standardToolTip = txt; }
    void setTooltipsTitle (QString txt) { m_tooltipsTitle = txt; }
    void setMessageTitle (QString txt) { m_messageTitle = txt; }
    void setMessageDuration (int seconds) { m_messageDuration = seconds; }
    void setAppTitle (QString txt) { m_appTitle = txt; }
    void setPub (QString txt) { m_pub = txt; }

};

#endif // SETTINGS_H
